<?php
$dbh=new PDO('mysql:host=localhost;dbname=gaofei','root','root');
//没有分页没有搜索  缓存
$memobj=memcache_connect('127.0.0.1',11211);
//memcache_flush($memobj);
$arr=$memobj->get('a');
if($arr=='')
{
    echo "没有缓存";
    $sql="select * from happy";
    $arr=$dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);
    $memobj->set('a',$arr,0,60*80*80);
    //$memobj=memcache_conn
}

?>
<a href="jthall.php">批量静态化</a>
<table border="1">
    <tr>
        <td>编号</td>
        <td>导演</td>
        <td>主演</td>
        <td>类型</td>
        <td>地区</td>
        <td>时间</td>
        <td>简介</td>
        <td>操作</td>
    </tr>
    <?php foreach($arr as $key=>$value) { ?>
        <tr>
            <td><?php echo $value['id']?></td>
            <td><?php echo $value['movie_director']?></td>
            <td><?php echo $value['movie_zhuyan']?></td>
            <td><?php echo $value['movie_type']?></td>
            <td><?php echo $value['movie_area']?></td>
            <td><?php echo $value['movie_time']?></td>
            <td><?php echo $value['movie_jj']?></td>
            <td>
                <a href="jth.php?id=<?php echo $value['id']?>">静态化</a>
                <a href="delete.php?id=<?php echo $value['id']?>">删除</a>
            </td>
        </tr>
    <?php } ?>
</table>
